package com.etymgiko.spaceshipshop.web;

import org.apache.struts.action.ActionForm;

/**
 * Form with hiddden inputs. 
 *
 * @author Ivan Holub
 */
public class HiddenForm  extends ActionForm {

    /**
     * User pressed search button.
     */
    private static final String ACTION_SEARCH = "search";

    /**
     * User clicked page navigation link.
     */
    private static final String ACTION_PAGE = "page";

    /**
     * Action. User pressed search button or clicked page navigation link.
     */
    String action;

    /**
     * Filter.
     */
    String search;

    /**
     * Number of page to navigate.
     */
    Integer page;

    /**
     * Old value of Filter.
     */
    String searchOld;

    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }

    public String getSearch() {
        return search;
    }

    public void setSearch(String search) {
        this.search = search;
    }

    public Integer getPage() {
        return page;
    }

    public void setPage(Integer page) {
        this.page = page;
    }

    public String getSearchOld() {
        return searchOld;
    }

    public void setSearchOld(String searchOld) {
        this.searchOld = searchOld;
    }

    public boolean isActionSearch() {
        return ACTION_SEARCH.equals(action);
    }

    public boolean isActionPage() {
        return ACTION_PAGE.equals(action);
    }

}
